import Cookies from 'js-cookie'

const KEY = 'token_key'

export function getToken() {
    const str = Cookies.get(KEY)
    if (!str) return null
    return JSON.parse(str)?.user?.token
}